<template>
  <div>
    <page-header title="管理员首页" content="" />
    <page-main>
      <H1>欢迎您，{{ account.name }}</H1>
      <panel-group :data="data" />
    </page-main>
  </div>
</template>

<script>
import PanelGroup from './components/PanelGroup.vue'
import { monitor } from '@/api/monitor'

export default {
  name: 'IndexAdmin',
  components: { PanelGroup },
  props: {},
  data() {
    return {
      account: JSON.parse(this.$store.state.user.account),
      data: {}
    }
  },
  created() {},
  mounted() {
    this.getList()
  },
  methods: {
    // 获取table数据
    async getList() {
      const params = {
        sessionId: this.$store.state.user.session_id
      }
      const result = await monitor.get(params)
      this.data = result.data
    }
  }
}
</script>

<style lang="scss" scoped>
.block {
    margin-bottom: 10px;
}
</style>
